/**
 *  @brief Brief description
 *  @athor victor.chen
 *  @corp  www.aiinone.cn
 */
 
#include "uartcom.h"
#include "mcurpc.h"


int main(void)
{
	//Initial rpc uart commication
	uint8_t keyval = 0;
	UartProtocolInit();
	for(;;) {

		keyval = 1;			
		if(keyval != -1){
			printf("keyval: %d\n\r",keyval);
			switch(keyval){
				case 1:
					RpcLaunchApp(0, 0);
					break;
				case 2:
					RpcSetBgImage(0, 0, 0, IMAGEU16ToU8_BE(ID_IMG_PROGRESS));
				  break;
				case 3:
					RpcSetBgImage(0, 0, 0, IMAGEU16ToU8_BE(0));
					RpcSetBgColor(0, 0, 0, 0, 255,0,255);
				  break;
				case 4:
					RpcSetCtrlAtt(0, 0, 0, ERPC_SETCTRLTATT_INVISIABLE);
					break;
				case 5:
					RpcSetCtrlAtt(0, 0, 0, ERPC_SETCTRLTATT_VISIABLE);
					break;						
				case 6:
					RpcSetColor(0, 0, 0, 255, 0,0,255);
					break;						
				case 7:
					RpcSetText(0,0,0,"Inone",sizeof("Inone"));
				  break;
				case 8:
					RpcSetTextAtt(0,0,0,ERPC_SETTEXTATT_BOLD|ERPC_SETTEXTATT_ITALIC|35);
					break;
				case 9:
					RpcSetTextAtt(0,0,0,20);
					break;
									
				default:
					RpcLaunchApp(0, 1);
					break;
			}
		}else{
			delay_ms(200);
		}
	}
}
